Compiled from

http://users.evitech.fi/~jaanah/IntroC/DBeech/3gl_flow.htm

http://en.wikipedia.org/wiki/Flowchart

http://www.nos.org/htm/basic2.htm

http://www.howell1964.freeserve.co.uk/Acorn/Atom/atap/atap_03.htm

 

 

 

What is a flow chart?

A flowchart (also spelled flow-chart and flow chart) is a schematic representation of a process.

 

They are commonly used in business/economic presentations to help the audience visualize the content better, or to find flaws in the process.


Examples include instructions for a bicycle's assembly, an attorney outlining a case's timeline, diagram of an automobile plant's work flow, the decisions to be taken on a tax form, et cetera.


Generally the start point, end points, inputs, outputs, possible paths and the decisions that lead to these possible paths are included.


 
Flow-charts can be created by hand, but lately specialized diagram drawing software has emerged that can also be used for the purpose, such as Visio and Dia.


A simple flowchart for what to do if a lamp doesn't work

A simple flowchart for what to do if a lamp doesn't work

 

 

Why use a flow chart?

  1. Communication: Flowcharts are better way of communicating the logic of a system to all concerned.
  2. Effective analysis: With the help of flowchart, problem can be analyzed in more effective way.
  3. Proper documentation: Program flowcharts serve as a good program documentation, which is needed for various purposes.
  4. Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and program development phase.
  5. Proper Debugging: The flowchart helps in debugging process.
  6. Efficient Program Maintenance: The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put efforts more efficiently on that part

The Language of flow charts

The major symbols are the DECISION (also known as selection) and the SEQUENCE (or process) symbols.

The START and STOP symbols are called the terminals.

The SUBPROCESS symbol is a variation on the sequence symbol. There are also connectors drawn between the symbols and you will see these used in the examples below. 

 


Guidelines

  1. In drawing a proper flowchart, all necessary requirements should be listed out in logical order.
  2. The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity in understanding the flowchart.
  3. The usual direction of the flow of a procedure or system is from left to right or top to bottom.
  4. Only one flow line should come out from a process symbol.

b3.gif (987 bytes)  or     b4.gif (993 bytes) 

  1. Only one flow line should enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol.

  b5.gif (1355 bytes)            b6.gif (1355 bytes)

  1. Only one flow line is used in conjunction with terminal symbol.

b7.gif (1091 bytes)                 b8.gif (1120 bytes)

  1. Write within standard symbols briefly. As necessary, you can use the annotation symbol to describe data or computational steps more clearly.

b9.gif (1308 bytes)

  1. If the flowchart becomes complex, it is better to use connector symbols to reduce the number of flow lines. Avoid the intersection of flow lines if you want to make it more effective and better way of communication.
  2. Ensure that the flowchart has a logical start and finish.
  3. It is useful to test the validity of the flowchart by passing through it with a simple test data.

 

Sequential Structures

A series of processes that follow in order.

 

flow chart with sequential steps

 

 


Conditionals

 

If …Then

The IF ... THEN construct is shown here and is also known as the NULL ELSE, meaning that there is no ELSE part.

conditional flowchart

 

If …Then… Else

The IF ... THEN ... ELSE ... construct has a process at each branch of the decision symbol. The only difference here is that each value of the decision  (TRUE/FALSE) has a process associated with it.

 


Repeat loop.

Note that the repeat loop has the process preceding the decision. This means that a repeat loop will always execute the process part at least once. This is an important point to remember because it may not be what you want to do. The repeat loop is usually written so that it iterates until the condition becomes true.

 

 

While Loop

The while loop is basically the reverse of the repeat loop, the decision comes first, followed by the process. The while loop is usually written so that it iterates while the condition is true. The while loop should be used when it is possible that the process or processes which are in the scope of the decision (that is, in the loop) may not need to execute.

while loop flow chart

FOR LOOP

for loop - 7 times


Examples

The following example is an attempt to provide an algorithm for putting on a shirt. Consider the possibility of attempting to tell a robot (which must have everything given to it) how to do this:

Flow chart example